import { getPostsPage, getAllCategories, type PostQueryParams, type PostPageResult } from '@/lib/index'
import { Suspense } from 'react'
import FilteredPosts from '@/components/FilteredPosts'


export default async function Home() {
  const postPage:PostPageResult = await getPostsPage({
    page: 1, 
    pageSize: 10, 
  })
  const categories = await getAllCategories()
  return (
    <main className="min-h-screen p-4 md:p-8">
      <div className="max-w-4xl mx-auto">
        <Suspense fallback={<div>加载中...</div>}>
          <FilteredPosts postPage={postPage} categories={categories}/>
        </Suspense>
      </div>
    </main>
  )
} 